<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height border-hover-style outline-style2">
    <div class="Showroom-parent" v-if="props.info.digitalShowroom">
      <digitalShowroomInfo :url="props.info.digitalShowroom" :id="props.info.id" />
    </div>
    <img class="outline-parent-bg" :src="publicUrls + 'free/style8/Level1outlineStyle8Bg.webp'" alt="" />
    <div
      class="outline jy-style-height"
      :class="{
        content3: !props.info.value && !props.info.remarks && !props.info.subTitle,

        content2: !props.info.value && !props.info.remarks && props.info.subTitle,
      }"
    >
      <div class="content-tiitle">
        <p class="title">
          <img class="title-top" :src="publicUrls + 'free/style8/Level1outlineStyle8Bgtitle1.webp'" alt="" />
          {{ props.info.text }}
          <img class="title-bottom" :src="publicUrls + 'free/style8/Level1outlineStyle8Bgtitle2.webp'" alt="" />
        </p>
      </div>

      <div class="outline-content">
        <p class="outline-subTitle" v-if="props.info.subTitle">{{ props.info.subTitle }}</p>
        <div
          class="cover"
          :class="{
            'img-box-1': !props.info.subTitle && props.info.remarks,
            'img-box-2': props.info.subTitle && !props.info.remarks,
            'img-box-3': !props.info.subTitle && !props.info.remarks,
          }"
          v-if="props.info.value"
        >
          <img
            class="outline-cover"
            @click="ImgVisible = true"
            :src="urls + props.info.value + '?imageView2/3/format/webp'"
            alt=""
          />
        </div>
        <div class="remarks1" v-if="props.info.value && props.info.remarks">
          <TextMax
            :infoData="props.info"
            v-if="props.domShow"
            :data="props.info.remarks"
            :title="props.info.text"
            :row="getRemarksNum(5, route.meta.loopType)"
          ></TextMax>
        </div>
        <div
          class="remarks2"
          :class="{
            remarks3: !props.info.subTitle,
          }"
          v-else-if="props.info.remarks"
        >
          <TextMax
            :infoData="props.info"
            v-if="props.domShow"
            :data="props.info.remarks"
            :title="props.info.text"
            :row="getRemarksNum(13, route.meta.loopType)"
          ></TextMax>
        </div>
      </div>
    </div>
  </div>
</template> 

<script lang="ts">
export default defineComponent({
  name: 'free8Style3',
});
</script>

<script setup lang="ts">
import { getRemarksNum } from '@/utils/minxin';
import { publicUrls, textType } from '@/utils/minxin';
import { getTextHtml } from '@/utils/minxin';
import digitalShowroomInfo from '@/freeComponents/unitdigitalShowroom/style8.vue';
import { urls } from '@/utils/request/upload';
import { defineComponent, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/TextMax.vue';
import { useProjectStore } from '@/store';
import { transform } from 'lodash';
import { useRouter, useRoute } from 'vue-router';
const ImgVisible = ref(false);
const store = useProjectStore();

const route = useRoute();
const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  position: relative;
  margin-right: 90px;
  margin-top: 0;
  margin-left: 120px;
  .Showroom-parent {
    position: absolute;
    top: 44px;
    right: 310px;
    z-index: 23;
  }
}
.outline-parent-bg {
  width: 654px;
  height: 100%;
  position: relative;
  z-index: 20;
}
.outline {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 20;
  display: flex;
  //   align-items: center;
  flex-direction: column;
  width: 100%;
  padding: 136px 0px 96px 0px;
}
.content3 {
}
.content2 {
}
.content-tiitle {
  width: 303px;
  height: 106px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 167px;
  .title {
    position: relative;
    padding: 12px 23.5px;
    width: 303px;
    // border-top: 2px solid rgba(79, 110, 92, 0.6);
    // border-bottom: 2px solid rgba(79, 110, 92, 0.6);
    font-family: 'SourceHanSerifCN-Bold';
    font-size: 32px;
    line-height: 36px;
    text-align: center;
    color: rgba(79, 110, 92, 1);
    .title-top,
    .title-bottom {
      position: absolute;

      left: 0;
      width: 303px;
      height: 2px;
    }
    .title-top {
      top: 0;
    }
    .title-bottom {
      bottom: 0;
    }
  }
  //   p {
  //     // height: 100%;
  //     // writing-mode: vertical-rl;
  //     // text-orientation: upright;
  //     // letter-spacing: 4px;
  //     // color: #4f6e5c;
  //     // text-align: center;
  //     // font-family: 'SourceHanSerifCN-Bold';
  //     // font-size: 32px;
  //     // line-height: 36px;
  //     // &:nth-child(2) {
  //     //   position: relative;
  //     //   margin-left: 10px;
  //     }
  //     // &:nth-child(2)::after {
  //     //   content: '';
  //     //   width: 1px;
  //     //   height: 100%;
  //     //   background: #4f6e5c;
  //     //   position: absolute;
  //     //   top: 0;
  //     //   left: 0;
  //     // }
  //   }
}

.outline-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 304px;
  margin-top: 70px;
  overflow: hidden;
  margin-left: 162px;
  .outline-subTitle {
    width: 290px;
    color: rgba(255, 255, 255, 1);
    text-align: center;
    font-family: 'SourceHanSerifCN';
    font-size: 18px;
    line-height: 24px;
    margin-bottom: 20px;
  }
  .cover {
    display: flex;
    align-items: center;
    width: 300px;
    height: 246px;
    overflow: hidden;
    margin-bottom: 20px;
    background: rgba(134, 161, 146, 0.4);
    &:hover img {
      transform: scale(1.2);
    }
    img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      transition: all 0.3s ease;
    }
  }
}
.img-box-1 {
  width: 300px;
  height: 246px;
}
.img-box-2 {
  width: 300px;
  height: 354px;
  margin-bottom: 0px;
}
.img-box-3 {
  width: 300px;
  height: 422px;
  margin-bottom: 0px;
}
.remarks1 {
  display: flex;
  width: 304px;
}
.remarks2 {
  display: flex;
  width: 304px;
}
.remarks3 {
  margin-top: 38px;
}
::v-deep .textMore-box {
  width: 304px;
}
::v-deep .van-text-ellipsis {
  font-family: PingFangSC !important;
  font-size: 16px !important;
  color: rgba(255, 255, 255, 0.59) !important;
  line-height: 32px !important;
}
::v-deep .van-text-ellipsis__action::before {
  color: rgba(255, 255, 255, 1) !important;
  font-weight: 400 !important;
  text-decoration-line: underline;
}
</style>